import { request } from "umi";


//评论管理
export function getComment(page: number = 1) {
  let params = {
    page,
    pageSize: 313,
    // status: 'publish'
  }
  return request('/api/comment', {
    params
  });
}
//搜索接口
export function getCommentSearch(obj: object) {
  return request(`/api/comment`, {
    params: obj
  });
}

//通过接口
export function getCommentPass(obj: any) {
  console.log(obj);
  return request(`/api/comment/${obj.id}`, {
    method: 'PATCH',
    data: {
      pass: obj.pass,
    }
  });
}

//拒绝接口
export function getCommentBack(obj: any) {
  console.log(obj);
  return request(`/api/comment/${obj.id}`, {
    method: 'PATCH',
    data: {
      pass: obj.pass,
    }
  });
}

//回复接口
export function getCommentContext(obj: any) {
  console.log(obj);
  return request(`/api/comment`, {
    method: 'POST',
    data: obj.data
  });
}

//删除接口
export function getCommentDelete(obj:any){
  return request(`/api/comment/${obj.id}`,{
      method:"DELETE"
  })
}
